/*
 * Array.hpp
 *
 *  Created on: 05/12/2011
 *      Author: marcio
 */

#ifndef ARRAY_HPP_
#define ARRAY_HPP_

class ArrayException : public Exception{

};

template<typename T>
class Array<T>{
private:
	T* elem;
	int size;
public:
	Array(int size);

	Array(List<T>* a);

	T getElem(long i);

	bool setElem(long i, T newElem);

	bool putElem(T newElem);

	bool order(int (*function)(T, T));

	bool isEmpty();

	int searchFor(T elem, int (*isEqual)(T, T));

	int sort(int (*comp)(T,T));

	virtual ~Array();

	T operator[](long i){ return getElem(i);}

	int operator+(T elem){return putElem(elem);}
};

#endif /* ARRAY_HPP_ */
